package com.sky.utils;

import com.sky.exception.ParamErrorException;

import java.util.Objects;

/**
 * 分页工具类
 */
public class PageUtils {
    public static void validatePageParams(int pageNum, int pageSize) {
        if (Objects.isNull(pageNum) || pageNum <= 0) {
            throw new ParamErrorException("pageNum不能为空且必须大于0");
        }
        if (Objects.isNull(pageSize) || pageSize <= 0) {
            throw new ParamErrorException("pageSize不能为空且必须大于0");
        }
    }
}
